
<link href="<?php echo Yii::app()->request->baseUrl; ?>/contents/RoyalSlider/css/royalslider.css" rel="stylesheet" />
<link href="<?php echo Yii::app()->request->baseUrl; ?>/contents/RoyalSlider/css/boxanh-rs-minimal-green.css" rel="stylesheet" />
<script src="<?php echo Yii::app()->request->baseUrl; ?>/contents/RoyalSlider/js/highlight.pack.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/contents/RoyalSlider/js/jquery.royalslider.min.js"></script>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/contents/Styles/boxanh-royal-slider.css" rel="stylesheet" />

<div id="full-width-slider" class="royalSlider heroSlider rsMinW">
	<?php 
		////////////////index slider///////////////////////
		$criteria = new CDbCriteria();
		$criteria->select = 'id, description, content_vn, content_en, image';
        $criteria->condition = 'status=:status AND type=:type';
		$criteria->params = array(':status'=> 1,':type'=> Advertising::AD_TYPE_BANNER );
		$criteria->limit = 5;
		$criteria->offset = 0;
        $criteria->order = 'creation_datetime DESC';
		$indexSlider = Advertising::model()->findAll($criteria);
		////////////////end index slider///////////////////
	?>
    <?php foreach($indexSlider as $item): ?>
    <div class="rsContent">
        <img class="rsImg" data-rsw="1400" data-rsh="500" src="<?php echo UrlHelper::productImage($item->image); ?>" />
        <div class="boxanhInfoBlock" data-fade-effect="" data-move-offset="" data-move-effect="" data-speed="">
            <div class="boxanhInfoBlock-content">
                <div class="row">
                    <h4><?php echo $item->content_t ?></h4>
                </div>
                <div class="row">
                    <p></p>
                    <a class="btn btn-quote" href="<?php echo $this->createUrl('/news/detail',array('id'=>$item->id)); ?>"><?php echo Yii::t("view_partials_indexSlider", "View mores"); ?></a>
                </div>
            </div>
        </div>
    </div>
	<?php endforeach; ?>
</div>

<script type="text/javascript">
    jQuery(document).ready(function ($) {0504
        
        $('#full-width-slider').royalSlider({
            arrowsNav: true,
            loop: true,
            keyboardNavEnabled: true,
            controlsInside: false,
            imageScaleMode: 'fill',
            imageAlignCenter: true,
            arrowsNavAutoHide: true,
            autoScaleSlider: true,
            autoScaleSliderWidth: 1400,
            autoScaleSliderHeight: 500,
            controlNavigation: 'bullets',
            thumbsFitInViewport: true,
            navigateByClick: false,
            startSlideId: 0,
            autoPlay: true,
            transitionType: 'move',
            globalCaption: false,
            deeplinking: {
                enabled: true,
                change: false
            },
            /* size of all images http://help.dimsemenov.com/kb/royalslider-jquery-plugin-faq/adding-width-and-height-properties-to-images */
            imgWidth: 1400,
            imgHeight: 500
        });
    });
</script>